/*
 * FileFilter.java
 *
 * Created on August 20, 2006, 5:49 PM
 *
 */
package org.letva.copie.client.gui;

/**
 *
 * @author Vuk Nikolic
 */
import java.io.File;

public class FileFilter extends javax.swing.filechooser.FileFilter {

	public FileFilter() {
	}

	public boolean accept(File f) {
		if (f != null) {
			if (f.isDirectory()) {
				return true;
			}
			String name = f.getName().toLowerCase();
			return name.endsWith(".txt");
		} else {
			return false;
		}
	}

	public String getDescription() {
		return "*.txt files";
	}
}
